package com.hopu.shop.server.imp;

import com.hopu.shop.dao.SupportType;
import com.hopu.shop.server.ShopTypeServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service("shopTypeServer")
public class ShopTypeServerImp implements ShopTypeServer {


    @Autowired
    SupportType supportType;

    @Override
    public List<?> typequery(Map map) throws Exception {
        return supportType.typequery("ShopTypeMapper.typequery",map);
    }

    @Override
    public int typeupd(Map map) throws Exception {
        Map maps=new HashMap();
        maps.put("keyMap",map);
        maps.put("shop_type_id",map.get("shop_type_id"));
        map.remove("shop_type_id");
        System.out.println("map="+maps);
        return supportType.typeupd("ShopTypeMapper.typeupd",maps);

    }

    @Override
    public int typesava(Map map) throws Exception {
        System.out.println("业务层的方法新转增="+map);
        return supportType.typesava("ShopTypeMapper.typesave",map);
    }

    @Override
    public int typedel(Map map) throws Exception {
        return supportType.typedel("ShopTypeMapper.typedel",map);
    }


    //查询总行数
    @Override
    public Map count(Map map) throws Exception {
        return supportType.count("ShopTypeMapper.count",map);
    }
}
